import { beforeAll } from 'vitest';

// Mock window.__POWERED_BY_QIANKUN__ for testing
beforeAll(() => {
  Object.defineProperty(window, '__POWERED_BY_QIANKUN__', {
    value: false,
    writable: true,
  });

  // Mock localStorage
  Object.defineProperty(window, 'localStorage', {
    value: {
      getItem: vi.fn(),
      setItem: vi.fn(),
      removeItem: vi.fn(),
      clear: vi.fn(),
    },
    writable: true,
  });

  // Mock location
  Object.defineProperty(window, 'location', {
    value: {
      href: 'http://localhost:3003',
      origin: 'http://localhost:3003',
    },
    writable: true,
  });
});
